<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vue中列表渲染</title>
</head>
<style>
    .activated {
        color: red;
    }
</style>
<body>
    <div id="app">
        <ul>
            <li v-for="(item, index) of list" :key="item.id">{{ item.text }}---{{ index }}</li>
        </ul>
        <ol>
            <li v-for="(item, key, index) of userInfo">
                {{key}} : {{item}} --- {{index}}
            </li>
        </ol>
    </div>
</body>
<script src="vue.js"></script>
<script>

    var vm = new Vue({
        el: '#app',
        data: {
            list: [
                {id: "1", text: 'hello'},
                {id: "2", text: 'good'},
                {id: "3", text: 'beautiful'},
                {id: "4", text: 'nice'},
                {id: "5", text: 'dell'},
            ],
            userInfo: {
                id: '233',
                name: 'hello',
                age: 23,
                sex: '男'
            }
        }
        
    })
</script>
</html>